package com.yixun.qfbao.xf.model.dto;

import io.swagger.annotations.ApiModelProperty;

import java.util.ArrayList;
import java.util.List;

/**
 * 楼盘城市分组
 * 
 * @author liushihao
 *
 */
public class CityGroupDto implements Comparable<CityGroupDto>{

	/**
	 * 首字母
	 */
	@ApiModelProperty("首字母拼音")
	private String cityFirEn;

	/**
	 * 首字母对应城市集合
	 */
	private List<PremisesCityDto> premisesVos;
	
	public void addPremisesCityDto (PremisesCityDto premisesCityDto) {
		if(premisesVos == null) {
			premisesVos = new ArrayList<>();
		}
		premisesVos.add(premisesCityDto);
	}
	
	public String getCityFirEn() {
		return cityFirEn;
	}

	public void setCityFirEn(String cityFirEn) {
		this.cityFirEn = cityFirEn;
	}

	public List<PremisesCityDto> getPremisesVos() {
		return premisesVos;
	}

	public void setPremisesVos(List<PremisesCityDto> premisesVos) {
		this.premisesVos = premisesVos;
	}

	public CityGroupDto(String cityFirEn, List<PremisesCityDto> premisesVos) {
		super();
		this.cityFirEn = cityFirEn;
		this.premisesVos = premisesVos;
	}

	public CityGroupDto() {
		super();
	}

	public CityGroupDto(String cityFirEn) {
		this.cityFirEn = cityFirEn;
	}

	/**
	 * 当前对象比较按照 拼音的首字母进行比较
	 */
	@Override
	public int compareTo(CityGroupDto cityGroupDto) {
		return this.cityFirEn.compareTo(cityGroupDto.getCityFirEn());
	}
}
